function [X, Y, W] = syntheticDataGeneratorApp2(M, N, d)
%function to generate syntetic data to fit our model


    %interval for the X data
    MAXVAL_X = 40;
    MINVAL_X = -20;
    
    MAXVAL_W = 40;
    MINVAL_W = -20;

    %generate source variables
    X = MINVAL_X + (MAXVAL_X - MINVAL_X) .* rand(M,N);
    
    %initialize W
    W = MINVAL_W + (MAXVAL_W - MINVAL_W) .* rand((d * N)+1,1);
    
    DummyY = X(:,1);
    
   %features generation
   [FY, F] = featuresConcatenation(DummyY, X, d);
   
    mF = size(F,1);
   
   F = [ones(mF,1), F];
   
   %make the linear prediction to be the Target variable
   %in this way the error will be zero (minimum for P and W)
   Y = F * W;
    
end
